require.config({
    baseUrl: '../javascripts/library', // 基础路径
    paths: {
        jquery: 'jquery',
        axios: 'axios',
        require: 'require'
    },
    shim: {

    }
});


require(['jquery', 'axios'], function($, axios) {
    axios.get('./product/getItems').then(res => {
        let data = res.data;


        let tempstring = '';


        data.forEach(el => {
            let picture = JSON.parse(el.picture);
            console.log(picture);

            tempstring += `<li class="list1">
            <a href="../html/product.html?product_id=${el.id}">
                <img src="${picture[0].src}" alt="">
                <p>${el.title}</p>
                <p>预订省200元 </p>
                <p>${el.price}</p>
            </a>
        </li>`

        })

        $('.hot_r_t').html(tempstring);


    }).catch(err => {
        console.log(err);
    });
});